<% if (props.language === "typescript") { %>
import { GluegunToolbox } from 'gluegun'
<% } %>  

module.exports = {
  name: 'generate',
  alias: ['g'],
  run: async <%= (props.language === "typescript") ? "(toolbox: GluegunToolbox)" : "toolbox" %> => {
    const {
      parameters,
      template: { generate },
      print: { info },
    } = toolbox

    const name = parameters.first

    await generate({
      template: 'model.<%= props.extension %>.ejs',
      target: `models/${name}-model.<%= props.extension %>`,
      props: { name },
    })

    info(`Generated file at models/${name}-model.<%= props.extension %>`)
  },
}
